const path = require("path");
module.exports = {
  mode: "production",
  entry: "./index.ts",
  output: {
    path: path.join(__dirname, "./dist"),
    filename: "index.js",
  },
  resolve: {
    // Add `.ts` and `.tsx` as a resolvable extension.
    extensions: [".ts", ".d.ts", ".tsx", ".js"],
  },
  module: {
    rules: [
      // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
      {
        test: /\.(js|ts)?$/,
        loader: "babel-loader",
        options: { presets: ["@babel/preset-env", "@babel/preset-typescript"] },
      },
    ],
  },
};
